package com.dangdang.action.authorize;

import com.dangdang.action.BaseAction;
import com.dangdang.domain.User;
import com.dangdang.util.Constants;

/**
 * @author Wangpeihu
 * @team [Never give up]
 * @since JDK1.6(建议)
 * @date 2010-1-26
 */
public class LoginInfoAction extends BaseAction {

	/** 标识用户是否登录 */
	private boolean isLogin;

	public boolean isLogin() {
		return this.isLogin;
	}

	public void setLogin(boolean isLogin) {
		this.isLogin = isLogin;
	}

	/**
	 * 执行方法
	 * 
	 * @return
	 */
	public String execute() {
		User user = (User) session.get(Constants.USER_KEY);
		if (null != user) {
			session.put(Constants.USER_KEY, user);
			isLogin = true;
		} else {
			isLogin = false;
		}
		return Constants.FORWARD_SUCCESS;
	}
}
